package com.baofu.paycore.service.factory.impl;

import com.baofu.paycore.manager.model.PayBaseBO;
import com.baofu.paycore.manager.model.TransferBO;
import com.baofu.paycore.service.facade.model.PayBaseDTO;
import com.baofu.paycore.service.factory.OrderFactory;
import com.baofu.paycore.service.factory.PayBaseFactory;
import com.baofu.paycore.service.processor.PayBaseProcessor;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * <p>
 * </p>
 * User:ames wang  Date: 2017/6/28
 */
@Component
public class UnfreezeTransferFactoryImpl extends PayBaseFactory implements OrderFactory {

    /**
     * 主单处理器
     */
    @Resource(name = "unfreezeTransferProcessor")
    private PayBaseProcessor commonProcessor;

    /**
     * 资金单处理器
     */
    @Resource(name = "unfreezeTransferFundProcessor")
    private PayBaseProcessor fundProcessor;

    @PostConstruct
    public void init(){
        processor.add(commonProcessor);
        processor.add(fundProcessor);
    }

    @Override
    public TransferBO build(PayBaseDTO baseDTO) {
        TransferBO transferBO = new TransferBO();
        super.buildBO(transferBO,baseDTO);
        return transferBO;
    }
}
